package com.hzit.pool.executor.controller;

import com.hzit.pool.executor.dto.StudentDto;
import com.hzit.pool.executor.service.ClassesService;
import com.hzit.pool.executor.service.StudentService;
import org.apache.http.annotation.Contract;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@Controller
@RequestMapping("/student")
public class StudentController {
	@Autowired
	private StudentService studentService;

	@GetMapping("/list")
	public String list(Model model) throws ExecutionException, InterruptedException {
		//1. 打印学生及班级列表
		StudentDto dto = studentService.findAll();
		model.addAttribute("dto",dto);
		//2. 输出到视图
		return "list";
	}
}
